//
//  ZFTabBarViewController.m
//  PersistentPlan
//
//  Created by zhoufei on 16/4/14.
//  Copyright © 2016年 zhoufei. All rights reserved.
//

#import "ZFTabBarViewController.h"
#import "ZFBaseNavigationController.h"
#import "ZFTab1ViewController.h"
#import "ZFTab2ViewController.h"

@implementation ZFTabBarViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self createSubViews];
}

- (void)createSubViews
{
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} forState:UIControlStateNormal];
    
    ZFTab1ViewController *tab1=[[ZFTab1ViewController alloc]init];
    ZFBaseNavigationController *nav1=[[ZFBaseNavigationController alloc]initWithRootViewController:tab1];
    nav1.title=@"首页";

    
    ZFTab2ViewController *tab2=[[ZFTab2ViewController alloc]init];
    ZFBaseNavigationController *nav2=[[ZFBaseNavigationController alloc]initWithRootViewController:tab2];
    nav2.title=@"设置";
    
    [self setViewControllers:@[nav1,nav2]];

    nav1.tabBarItem.titlePositionAdjustment=UIOffsetMake(0, -15);
    nav2.tabBarItem.titlePositionAdjustment=UIOffsetMake(0, -15);
    

    
}

- (void)layoutTabItemLayer:(UIView*)view
{
    self.view.layer.borderColor=[UIColor lightGrayColor].CGColor;
    self.view.layer.borderWidth=1;
    self.view.layer.masksToBounds=YES;
    self.view.layer.cornerRadius=2;
}

@end
